package cn.chenshiwu121.controller;

import cn.chenshiwu121.pojo.EasyUITreeNode;
import cn.chenshiwu121.service.ItemCatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class ItemCatController {

    @Autowired
    private ItemCatService service;

    @RequestMapping(value = "/item/cat/list", method = RequestMethod.POST)
    @ResponseBody
    public List<EasyUITreeNode> getItemCatList(@RequestParam(value = "id", defaultValue = "0") Long parentId) {
        return service.getItemCatList(parentId);
    }

}
